package com.irs.irsforum.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author yihuili
 * @since 2020-01-18
 */
@Data
@TableName("forum_favorite")
public class Favorite extends Model<Favorite> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	@TableField("post_id")
	private Long postId;
	@TableField("user_id")
	private Long userId;
	/** 0：不存在 1:存在*/
	@TableField("favorite_type")
	private Integer favoriteType;

	public Favorite(Long postId, Long userId, Integer favoriteType) {
		this.postId = postId;
		this.userId = userId;
		this.favoriteType = favoriteType;
	}

	public Favorite() {
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "Favorite{" +
				"id=" + id +
				", postId=" + postId +
				", userId=" + userId +
				", favoriteType=" + favoriteType +
				'}';
	}
}
